<template>
  <div>
    <el-page-header content="详情页面" @back="goBack"/>
    <h1>{{ newsInfo.newsTitle }}</h1>
    <p>{{ newsInfo.newsContents }}
    </p>
    <p>作者:{{ newsInfo.newsAuthor }}</p>
    <p>发布时间:{{ newsInfo.publishTime }}</p>
    <p>最后编辑时间:{{ newsInfo.lastEditTime }}</p>

  </div>

</template>

<script>

export default {
  name: "u_showInfo",
  data() {
    return {

      newsId: '',
      newsInfo: {
        newsTitle: '',
        newsContents: '',
        newsAuthor: '',
        publishTime: '',
        lastEditTime: ''
      },
    }
  },
  created() {
    this.newsId = this.$route.query.newsId;
    this.getInfo();

  },
  methods: {
    getInfo() {
      this.axios
          .get("/news/show/" + this.newsId)
          .then(res => {
            this.newsInfo = res.data.data;
          })

    },
    goBack() {
      window.history.back();
    }
  }
}
</script>

<style scoped>

</style>